package cn.easy.common.util;

import java.util.Random;
import java.util.UUID;
/**
 * @author 谢子豪
 * @time 2017/10/3
 * @description 得到用户的key
 */
public class UserUUID {
    /**
     * 采用uuid生成用户随机数，并将其中的-替换成随机0~9的数字
     * @return
     */
    public  static  String getUserUUID(){
        UUID uuid = UUID.randomUUID();
        String[] split = uuid.toString().split("-");
        StringBuilder builder = new StringBuilder();
        Random random = new Random();
        for(int i=0;i<split.length;i++){
            builder.append(split[0]);
            builder.append(random.nextInt(10));
        }
        return builder.toString();
    }
}
